﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace DataAnalyse
{
    /// <summary>
    /// LoginWdw.xaml 的交互逻辑
    /// </summary>
    public partial class LoaderWindows : Window
    {
        public LoaderWindows()
        {
            InitializeComponent();
            BitmapImage imageSource = new BitmapImage();
            imageSource.BeginInit();
            imageSource.StreamSource=AppStatic.restUtils.initImage();
            imageSource.EndInit();
            ImageBrush imageBrush = new ImageBrush(imageSource);
            this.border.Background = imageBrush;
            this.Loaded += LoginWdw_Loaded;
        }

        private void LoginWdw_Loaded(object sender, RoutedEventArgs e)
        {
            Thread thread = new Thread(() =>
            {
                Thread.Sleep(5000);
                Action action = () =>
                {
                    this.DialogResult = true;
                    this.Close();
                };
                this.Dispatcher.BeginInvoke(action);
            });
            thread.Start();
        }
    }
}
